feat(state): let delta coroutines drop their key via sentinel#6673
Conversation
A coroutine value in a delta can now resolve to _DROP_FROM_DELTA to omit its key, so inclusion that can only be decided asynchronously is deferred into the delta and resolved post-hoc by _resolve_delta. Emptied state subdicts are removed as well.
Merging this PR will degrade performance by 3.27%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Greptile SummaryThis PR introduces two related changes: a
Confidence Score: 5/5Safe to merge — both changes are well-scoped, the sentinel logic handles all mixed-value cases correctly, and the EventContext rebinding properly restores caller state on exit. The No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "chore(state): add Final to typing import..." | Re-trigger Greptile |
Out-of-band modify_state (e.g. the shared-state fan-out recomputing another client's delta) runs in a task that copied the triggering event's EventContext. Fork and rebind the context to the modified token so consumers inside -- delta resolution, computed vars -- observe that token rather than the actor's inherited one. No-op when no EventContext is set.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
A coroutine value in a delta can now resolve to _DROP_FROM_DELTA to omit its key, so inclusion that can only be decided asynchronously is deferred into the delta and resolved post-hoc by _resolve_delta. Emptied state subdicts are removed as well.
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features: